<!-- 快速启动 -->
<template>
  <div class="bg-color-fffff">
    <!-- <div class="font-size-18 padding-20 font-weight-700"></div> -->
    <div class="flex warp padding-left-20 padding-top-20">
      <template v-for="(item, i) in m_List">
        <div class="box" v-if="$verifyPerms(item.code)" @click="click(item.code)" :key="i">
          <img class="img margin-right-5" :src="item.icon">
          {{ item.name }}
        </div>
      </template>
    </div>
    <AddWork ref="addWork" :isProjectKey="isProjectKey" v-if="dialogShow"></AddWork>
    <newProjectDialog ref="newProject"></newProjectDialog>
    <reimbursement ref="reimbursement"></reimbursement>
  </div>
</template>
<script>
  import dayjs from 'dayjs';
  import AddWork from '@/pages/businessAssets/pages/workTrace/components/addWork';
  import newProjectDialog from '../components/newProjectDialog.vue';
  import reimbursement from './reimbursement.vue';
export default {
  components: { AddWork, newProjectDialog,reimbursement },
  data() {
    return {
      isProjectKey:false,
      dialogShow:false,
      m_List: [
        {
          name: '合同起草',
          code: 'contractDrafting',
          icon:require("../assets/imgs/hetongqicao.png")
        },
        {
          name: '合同付款',
          code: 'contractPayment',
          icon:require("../assets/imgs/hetongfukuan.png")
        },
        {
          name: '事件上报',
          code: 'eventReport',
          icon:require("../assets/imgs/shijianshangbao.png")
        },
        {
          name: '拆合铺',
          code: 'projectInfoBase',
          icon:require("../assets/imgs/chaipu.png")
        },
        {
          name: '广告位管理',
          code: 'projectInfoAd',
          icon:require("../assets/imgs/ad.png")
        },
        {
          name: '停车场管理',
          code: 'projectInfoPark',
          icon:require("../assets/imgs/park.png")
        },
        {
          name: '导入银行数据',
          code: 'incomeExpenditureDataManagement',
          icon:require("../assets/imgs/yinhanshuju.png")
        },
        {
          name: '报销',
          code: 'reimbursement',
          icon:require("../assets/imgs/baoxiao.png")
        },
        {
          name: '非合同收入',
          code: 'homeNoContractGather',
          icon:require("../assets/imgs/feihetong.png")
        },
        {
          name: '录入付款',
          code: 'homePayment',
          icon:require("../assets/imgs/fukuan.png")
        },
      ],
    };
  },
 
  props: {
    from:{
      type: String,
      default: ''
    },
  },
 
  methods: {
    click(res) {
      let url = null;
      if (res == 'contractDrafting') {
        url = '/businessAssets/ContractManage/draft?menuId=909ad6831acb46a9aebb0675ba6943fc&tabId=a0a8ab12f6f945d8b1f77a30b83d21ea&parentMenuId=7ee2400d0e72437aa3bdb5823497537f&timestamp=1654062761947&TAB=2';
      }
      if (res == 'contractPayment') {
        url = '/businessAssets/ContractManage/prePayment?menuId=909ad6831acb46a9aebb0675ba6943fc&tabId=f75af6193b274eba86ef3e8115890321&parentMenuId=7ee2400d0e72437aa3bdb5823497537f&timestamp=1654062761947&TAB=1';
      }
      if (res == 'projectInfoAd' || res == 'projectInfoPark' || res == 'projectInfoBase') {
        url = '/businessAssets/projectView/projectInfo?menuId=642639771fc14b8ab146f53320e0de27&parentMenuId=7ee2400d0e72437aa3bdb5823497537f&timestamp=1654684136333&authCode=' + res;
      }
      if (res == 'incomeExpenditureDataManagement') {
        url = '/businessAssets/more/projectFinace?ifInMore=2&menuId=07b2cfc68e4e4bad9dd2479225960955&parentMenuId=7ee2400d0e72437aa3bdb5823497537f&timestamp=1654064266489';
      }
      if (res == 'homeNoContractGather' || res == 'homePayment') {
        this.$message.warning("正在建设中")
        return
      }
     
      if (res == 'eventReport') {
        if(this.from){
          this.isProjectKey = true
        }else{
          this.isProjectKey = false
        }
        this.dialogShow = true
        setTimeout(() => {
          this.$refs['addWork'].dialogShow = true;
        }, 0);
        
      }
      if (res == 'addNewItem') {
        this.$refs.newProject.showFurther = true;
      }
      if (res == 'reimbursement') {
        this.$refs.reimbursement.showFurther = true;
      }
      if (url) window.open(url);
      },
    },
  };
</script>
<style scoped lang="scss">
  .box {
    width: fit-content;
    height: 40px;
    width: 125px;
    background-color: #fbfbfb;
    padding: 10px;
    border-radius: 6px;
    position: relative;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    color: #666666;
    display: flex;
    align-items: center;
    justify-content: left;
  }
  .box:hover{
    background-color: rgba(51, 132, 254, 0.1);
    color: #3384FE;
  }
  .bg-color-fffff {
    height: 180px;
    overflow: auto;
  }
  .img{
    width: 13px;
    height: 13px;
    color: #666666;
  }
</style>
